import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'assets/css/layout.scss'
import 'assets/css/custom.scss'
import api from './API/api'
import vue3PreviewImage from 'vue3-preview-image' // 图片预览
import SvgIcon from 'components/SvgIcon.vue'
import { ElMessage  } from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import moment from 'moment'

let app = createApp(App).use(store).use(router).use(ElementPlus, {locale: zhCn}).use(vue3PreviewImage)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.config.globalProperties.$message = ElMessage
app.config.globalProperties.$moment = moment
app.config.globalProperties.$api = api
app.component('SvgIcon', SvgIcon)
router.isReady().then(() => app.mount('#app'))
